package server.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import server.model.entity.FrmDataResources;

import java.util.List;

/**
 * 创建人:    xvzhe
 * 创建时间:
 * 修改时间:
 * 版本:      v1.0
 */
public interface FrmDataResourcesDao extends JpaRepository<FrmDataResources, String> {
    List<FrmDataResources> findByType(FrmDataResources.Type type);

    FrmDataResources findByUri(String uri);

    @Modifying
    @Query(value = "insert into frm_permissions_data_resources(frm_permissions_id,data_resources_id) values (?2,?1) ", nativeQuery = true)
    Integer insertPermissionsData(String dataId, String permissionsId);
}
